import VueRouter from "vue-router";
import Vue from "vue";
Vue.use(VueRouter);
import Home from "@/views/Home.vue";
import Login from "@/views/login.vue";
const staticRoutes = [
    {
        path:'/',
        redirect:'/login'
    },
    {
        path:'/login',
        name:'login',
        component:Login
    },
    //仪表盘
    {
        path:'/dashboard',
        name:'dashboard',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/dashboard/index.vue')
            }
        ]
    },
    //项目
    {
        path:'/project',
        name:'project',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/project/index.vue')
            }
        ]
    },
    //日历
    {
        path:'/calendar',
        name:'calendar',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/calendar/index.vue')
            }
        ]
    },
    //假期
    {
        path:'/holiday',
        name:'holiday',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/holiday/index.vue')
            }
        ]
    },
    //雇员
    {
        path:'/employee',
        name:'employee',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/employee/index.vue')
            }
        ]
    },
    //消息
    {
        path:'/message',
        name:'message',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/message/index.vue')
            }
        ]
    },
    //门户网站
    {
        path:'/portal',
        name:'portal',
        component:Home,
        children:[
            {
                path:'',
                component:()=>import('../views/portal/index.vue')
            }
        ]
    },
    {
        path:'/404',
        name:'404',
        component:()=>import('../views/404.vue')
    },
    {
        path:"*",
        redirect:'/404'
    }
]
// const asyncRoutes = []
const router=new VueRouter({
    mode:"history",
    routes:staticRoutes
})
export default router;